\(\int \frac {1}{a b+\sqrt {b^2-4 a b^3} x-b^2 x^2} \, dx\) [99]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 30, antiderivative size = 33 \[ \int \frac {1}{a b+\sqrt {b^2-4 a b^3} x-b^2 x^2} \, dx=\frac {2 \text {arctanh}\left (\frac {-\sqrt {b^2-4 a b^3}+2 b^2 x}{b}\right )}{b} \]

[Out]

2*arctanh((2*b^2*x-(-4*a*b^3+b^2)^(1/2))/b)/b

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 58, normalized size of antiderivative = 1.76, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.067, Rules used = {630, 31} \[ \int \frac {1}{a b+\sqrt {b^2-4 a b^3} x-b^2 x^2} \, dx=\frac {\log \left (-\sqrt {b^2-4 a b^3}+2 b^2 x+b\right )}{b}-\frac {\log \left (\sqrt {b^2-4 a b^3}-2 b^2 x+b\right )}{b} \]

[In]

Int[(a*b + Sqrt[b^2 - 4*a*b^3]*x - b^2*x^2)^(-1),x]

[Out]

-(Log[b + Sqrt[b^2 - 4*a*b^3] - 2*b^2*x]/b) + Log[b - Sqrt[b^2 - 4*a*b^3] + 2*b^2*x]/b

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 630

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/Simp
[b/2 - q/2 + c*x, x], x], x] - Dist[c/q, Int[1/Simp[b/2 + q/2 + c*x, x], x], x]] /; FreeQ[{a, b, c}, x] && NeQ
[b^2 - 4*a*c, 0] && PosQ[b^2 - 4*a*c] && PerfectSquareQ[b^2 - 4*a*c]

Rubi steps \begin{align*} \text {integral}& = -\left (b \int \frac {1}{\frac {1}{2} \left (-b+\sqrt {b^2-4 a b^3}\right )-b^2 x} \, dx\right )+b \int \frac {1}{\frac {1}{2} \left (b+\sqrt {b^2-4 a b^3}\right )-b^2 x} \, dx \\ & = -\frac {\log \left (b+\sqrt {b^2-4 a b^3}-2 b^2 x\right )}{b}+\frac {\log \left (b-\sqrt {b^2-4 a b^3}+2 b^2 x\right )}{b} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(120\) vs. \(2(33)=66\).

Time = 0.12 (sec) , antiderivative size = 120, normalized size of antiderivative = 3.64 \[ \int \frac {1}{a b+\sqrt {b^2-4 a b^3} x-b^2 x^2} \, dx=\frac {-2 \sqrt {b^2-4 a b^3} \arctan \left (\frac {-1+2 b x}{\sqrt {-1+4 a b}}\right )+2 \sqrt {b^2-4 a b^3} \arctan \left (\frac {1+2 b x}{\sqrt {-1+4 a b}}\right )+b \sqrt {-1+4 a b} \left (\log \left (a+x+b x^2\right )-\log (a+x (-1+b x))\right )}{2 b^2 \sqrt {-1+4 a b}} \]

[In]

Integrate[(a*b + Sqrt[b^2 - 4*a*b^3]*x - b^2*x^2)^(-1),x]

[Out]

(-2*Sqrt[b^2 - 4*a*b^3]*ArcTan[(-1 + 2*b*x)/Sqrt[-1 + 4*a*b]] + 2*Sqrt[b^2 - 4*a*b^3]*ArcTan[(1 + 2*b*x)/Sqrt[
-1 + 4*a*b]] + b*Sqrt[-1 + 4*a*b]*(Log[a + x + b*x^2] - Log[a + x*(-1 + b*x)]))/(2*b^2*Sqrt[-1 + 4*a*b])

Maple [A] (verified)

Time = 2.30 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.94

method result size
default \(-\frac {2 \,\operatorname {arctanh}\left (\frac {-2 b^{2} x +\sqrt {-b^{2} \left (4 a b -1\right )}}{b}\right )}{b}\) \(31\)

[In]

int(1/(a*b-b^2*x^2+x*(-4*a*b^3+b^2)^(1/2)),x,method=_RETURNVERBOSE)

[Out]

-2/b*arctanh((-2*b^2*x+(-b^2*(4*a*b-1))^(1/2))/b)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 63 vs. \(2 (31) = 62\).

Time = 0.43 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.91 \[ \int \frac {1}{a b+\sqrt {b^2-4 a b^3} x-b^2 x^2} \, dx=\frac {\log \left (\frac {2 \, b^{2} x + b - \sqrt {-4 \, a b^{3} + b^{2}}}{b}\right ) - \log \left (\frac {2 \, b^{2} x - b - \sqrt {-4 \, a b^{3} + b^{2}}}{b}\right )}{b} \]

[In]

integrate(1/(a*b-b^2*x^2+x*(-4*a*b^3+b^2)^(1/2)),x, algorithm="fricas")

[Out]

(log((2*b^2*x + b - sqrt(-4*a*b^3 + b^2))/b) - log((2*b^2*x - b - sqrt(-4*a*b^3 + b^2))/b))/b

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 56 vs. \(2 (26) = 52\).

Time = 0.14 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.70 \[ \int \frac {1}{a b+\sqrt {b^2-4 a b^3} x-b^2 x^2} \, dx=- \frac {\log {\left (x - \frac {1}{2 b} - \frac {\sqrt {- 4 a b^{3} + b^{2}}}{2 b^{2}} \right )} - \log {\left (x + \frac {1}{2 b} - \frac {\sqrt {- 4 a b^{3} + b^{2}}}{2 b^{2}} \right )}}{b} \]

[In]

integrate(1/(a*b-b**2*x**2+x*(-4*a*b**3+b**2)**(1/2)),x)

[Out]

-(log(x - 1/(2*b) - sqrt(-4*a*b**3 + b**2)/(2*b**2)) - log(x + 1/(2*b) - sqrt(-4*a*b**3 + b**2)/(2*b**2)))/b

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 55, normalized size of antiderivative = 1.67 \[ \int \frac {1}{a b+\sqrt {b^2-4 a b^3} x-b^2 x^2} \, dx=-\frac {\log \left (\frac {2 \, b^{2} x - b - \sqrt {-4 \, a b^{3} + b^{2}}}{2 \, b^{2} x + b - \sqrt {-4 \, a b^{3} + b^{2}}}\right )}{b} \]

[In]

integrate(1/(a*b-b^2*x^2+x*(-4*a*b^3+b^2)^(1/2)),x, algorithm="maxima")

[Out]

-log((2*b^2*x - b - sqrt(-4*a*b^3 + b^2))/(2*b^2*x + b - sqrt(-4*a*b^3 + b^2)))/b

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 56, normalized size of antiderivative = 1.70 \[ \int \frac {1}{a b+\sqrt {b^2-4 a b^3} x-b^2 x^2} \, dx=-\frac {\log \left (\frac {{\left | 2 \, b^{2} x - \sqrt {-4 \, a b + 1} {\left | b \right |} - {\left | b \right |} \right |}}{{\left | 2 \, b^{2} x - \sqrt {-4 \, a b + 1} {\left | b \right |} + {\left | b \right |} \right |}}\right )}{{\left | b \right |}} \]

[In]

integrate(1/(a*b-b^2*x^2+x*(-4*a*b^3+b^2)^(1/2)),x, algorithm="giac")

[Out]

-log(abs(2*b^2*x - sqrt(-4*a*b + 1)*abs(b) - abs(b))/abs(2*b^2*x - sqrt(-4*a*b + 1)*abs(b) + abs(b)))/abs(b)

Mupad [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.15 \[ \int \frac {1}{a b+\sqrt {b^2-4 a b^3} x-b^2 x^2} \, dx=-\frac {2\,\mathrm {atanh}\left (\frac {\sqrt {b^2-4\,a\,b^3}}{\sqrt {b^2}}-\frac {2\,b^2\,x}{\sqrt {b^2}}\right )}{\sqrt {b^2}} \]

[In]

int(1/(a*b + x*(b^2 - 4*a*b^3)^(1/2) - b^2*x^2),x)

[Out]

-(2*atanh((b^2 - 4*a*b^3)^(1/2)/(b^2)^(1/2) - (2*b^2*x)/(b^2)^(1/2)))/(b^2)^(1/2)